{include file="public/header" /}
<div class="page">
    <div class="fixed-bar">
        <div class="item-title">
            <div class="subject">
                <h3>项目定制订单</h3>
                <h5></h5>
            </div>
            {include file="public/admin_items" /}
        </div>
    </div>
    <form method="get">
        <div class="ds-search-form">
            <dl>
                <dt>{$Think.lang.ds_order_sn}</dt>
                <dd><input type="text" class="text w150" name="order_sn" value="{$Request.param.order_sn}"></dd>
                <dt>{$Think.lang.ds_buyer_name}</dt>
                <dd>
                    <input type="text" class="text w80" name="buyer_name" value="{$Request.param.buyer_name}">
                </dd>
            </dl>
            <dl>
                <dt>{$Think.lang.order_state}</dt>
                <dd>
                    <select name="order_state" class="querySelect">
                        <option value="">{$Think.lang.ds_please_choose}</option>
                        <option value="0" {if condition="$Request.param.order_state eq '0'"}selected{/if}>待付款</option>
                        <option value="10" {if condition="$Request.param.order_state eq '10'"}selected{/if}>待收货</option>
                        <option value="20" {if condition="$Request.param.order_state eq '20'"}selected{/if}>已完成</option>
                        <option value="30" {if condition="$Request.param.order_state eq '30'"}selected{/if}>已取消</option>
                        <option value="40" {if condition="$Request.param.order_state eq '40'"}selected{/if}>待退款</option>
                    </select>
                </dd>
                <dt>项目名称</dt>
                <dd><input type="text" class="text w150" name="project_name" value="{$Request.param.project_name}"></dd>
            </dl>
            <dl>
                <dt>{$Think.lang.order_time_from}</dt>
                <dd>
                    <input type="text" class="txt date" name="query_start_time" id="query_start_time" value="{$Request.param.query_start_time}">
                    &nbsp;–&nbsp;
                    <input id="query_end_time" class="txt date" type="text" name="query_end_time" value="{$Request.param.query_end_time}">
                </dd>
            </dl>
            <div class="btn_group">
                <input type="submit" class="btn" value="{$Think.lang.ds_search}" style="display: inline-block;">
                {if $filtered}
                <a href="{:url('projectorder/index2')}" class="btn btn-default" title="{$Think.lang.ds_cancel}">{$Think.lang.ds_cancel}</a>
                {/if}
            </div>
        </div>
    </form>

    <table class="ds-default-table">
        <thead>
        <tr>
            <th>订单编号</th>
            <th>买家账号</th>
            <th>下单时间</th>
            <th>项目名称</th>
            <th>订单总价</th>
            <th>订单状态</th>
            <th>操作</th>
        </tr>
        </thead>
        {empty  name="order_list"}
        <tbody>
        <tr class="no_data">
            <td colspan="20">{$Think.lang.no_record}</td>
        </tr>
        </tbody>
        {else /}
        <tbody>
        {foreach name="order_list" item="order"}
        <tr>
            <td>{$order.order_sn}</td>
            <td>{$order.buyer_name}</td>
            <td>{$order.add_time|date='Y-m-d H:i:s',###}</td>
            <td>{$order.project_name}</td>
            <td>{$order.order_amount}</td>
            <td>
                {if condition="($order.order_state==40)"}已完成
                {elseif condition="($order.order_state!=40)"}{$order_status[$order['order_state']]}
                {/if}
            </td>
            <td>
                <a href="{:url('projectorder/projectorder_list',['order_id'=>$order.order_id])}" class="dsui-btn-view"><i class="iconfont"></i>查看</a>

                <?php if($order['order_state']==60 || $order['order_state'] == 30){ ?>
                    <!-- <a href="{:url('projectorder/generate_service_single',['order_id'=>$order.order_id,'project_id'=>$order.project_id])}" class="dsui-btn-edit"><i class="iconfont"></i>生成服务单</a> -->
                <?php }?>
                 <!--    <a href="javascript:dsLayerOpen('{:url('projectorder/projectorder_list',['order_id'=>$order.order_id])}','{$Think.lang.ds_view}{$Think.lang.ds_order}-{$order.order_sn}')" class="dsui-btn-view">
                        <i class="iconfont"></i>
                      查看
                    </a> -->
                    
                </td>
        {/foreach}
        </tbody>
        {/empty}
    </table>
    {$show_page}
</div>

<script type="text/javascript">
    $(function(){
        $('#query_start_time').datepicker({dateFormat: 'yy-mm-dd'});
        $('#query_end_time').datepicker({dateFormat: 'yy-mm-dd'});
    });
</script>

